// Lang_13 [operators].nova // The application class. class OperatorsApp { // Application class's "main" function. public static void main( String[] args ) { // Declare an integer for the results. int result; // Example a. result = 8 - 3 - 2; // Calculated as (8 - 3) - 2, giving 3, and and not as 8 - (3 - 2). Stream.writeLine( "Correct = 3, actual = " + Integer.toString( result ) ); // Example b. result = 1 * 2 + 3 * 4 + 5 * 6 + 2 / 2 * 8 / 2; // Calculated as (1 * 2) + (3 * 4) + (5 * 6) + (2 / 2 * 8 / 2) producing, // 2 + 12 + 30 + 4 = 48. Stream.writeLine( "Correct = 48, actual = " + Integer.toString( result ) ); // Example c. int i = 0; // Declare an integer with a value of zero. result = 1 * ++i + 3 * ++i + 5 * ++i + 7 * ++i; // Calculated as (1 * ++i) + (3 * ++i) + (5 * ++i) + (7 * ++i) producing, // (1 * 1) +(3 * 2) + (5 * 3) + (7 * 4) producing, // 1 + 6 + 15 + 28 = 50. Stream.writeLine( "Correct = 50, actual = " + Integer.toString( result ) ); } }